function main(params) {
    debugger
    const self = this;

    const formPartEle = self.$$("form_part_5plzns");
    const formRenderEle = formPartEle.$$getRenderElement();

    const appointmentVerifyId = self.$$("number_input_d7d6").cValue;
    const applyUseEndDate = self.$$("date_picker_fleyff").cValue;
    const today = new Date();
    const todayString = today.toLocaleDateString();

    let applyUseDateString = todayString + ' ~ ' + applyUseEndDate
    self.$ztDialog.confirm({
        title: `是否取消${applyUseDateString}的摊位预约？`,
        showConfirmButton: true,
        showCancelButton: true,
        cancelButtonText: "取消",
        confirmButtonText: "确定",
    }).then(function () {
        if (formRenderEle) {
            formRenderEle.onSave().then((res) => {
                if (res && res.result) {
                    console.log("保存成功", res);
                    let removeAppointmentVerifyId = res.result.documentNo;
                    updateLawStallAppointmentRecordInfo(self, appointmentVerifyId, removeAppointmentVerifyId)
                    // 返回上个页面
                    let pageRenderElement = self.$$root().$parent.$parent.$parent;
                    pageRenderElement.goHistory(-1);
                }
            });
        }
    }).catch(function () {
        console.log("用户点击了取消");
    });
    return
}

/**
 * 更新预约审核记录 law_stall_appointment_record_info
 * 申请取消预约
 */
function  updateLawStallAppointmentRecordInfo(self, appointmentVerifyId, removeAppointmentVerifyId) {
    let updateSql = "UPDATE('ds_tbl:t_bff53c221c8c45898d6ce2809c4eb637',QUERY_EQ('appointment_verify_id'," + appointmentVerifyId + "),'',['remove_appointment_verify_id','"+removeAppointmentVerifyId+"','appointment_state_id','-2'])"
    api.EXEC_FORMULA(updateSql).then((res) => {
        console.log(res)
    })
}
